package it.ap.sa.core.rule.bean;

import java.io.Serializable;

/**
 * @author Alessandro Paolillo
 */
public class UpdateRuleBean implements Serializable{

	private static final long serialVersionUID = 4354110702130815297L;

	public UpdateRuleBean() {
	}


	public UpdateRuleBean(long ruleId, UpdateRuleOperation operation) {
		super();
		this.ruleId = ruleId;
		this.operation = operation;
	}

	private long ruleId;
	private UpdateRuleOperation operation;

	/**
	 * @return the ruleId
	 */
	public long getRuleId() {
		return ruleId;
	}
	/**
	 * @param ruleId the ruleId to set
	 */
	public void setRuleId(long ruleId) {
		this.ruleId = ruleId;
	}
	/**
	 * @return the operation
	 */
	public UpdateRuleOperation getOperation() {
		return operation;
	}
	/**
	 * @param operation the operation to set
	 */
	public void setOperation(UpdateRuleOperation operation) {
		this.operation = operation;
	}
	/**
	 * @author Alessandro Paolillo
	 */
	@Override
	public String toString() {
		return "UpdateRuleBean [ruleId=" + ruleId + ", operation=" + operation + "]";
	}
	/**
	 * @author Alessandro Paolillo
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((operation == null) ? 0 : operation.hashCode());
		result = prime * result + (int) (ruleId ^ (ruleId >>> 32));
		return result;
	}
	/**
	 * @author Alessandro Paolillo
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UpdateRuleBean other = (UpdateRuleBean) obj;
		if (operation == null) {
			if (other.operation != null)
				return false;
		} else if (!operation.equals(other.operation))
			return false;
		if (ruleId != other.ruleId)
			return false;
		return true;
	}

}
